﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace Elektronix.Class
{
    public class Markalar
    {

        public int supplierID { get; set; }
        public string brand { get; set; }
        public string brandlink { get; set; }
        public string info { get; set; }
        public string css { get; set; }


        public Markalar()
        { }

        public static List<Markalar> markalarigetir()
        {
            List<Markalar> mrk = new List<Markalar>();
            SqlConnection sqlcon = connection.baglanti;
            SqlCommand sqlcmd = new SqlCommand("select * from  markalar",sqlcon);
            sqlcon.Open();
            SqlDataReader sdr = sqlcmd.ExecuteReader();
            while (sdr.Read())
            {   
                Markalar m = new Markalar();
                m.supplierID = (int)sdr["supplierID"];
                m.brand = sdr["brand"].ToString();
                m.brandlink = sdr["brandlink"].ToString();
                m.info = sdr["info"].ToString();
                if (m.supplierID %2==0)
                {
                    m.css = "even";
                }
                else
                {
                    m.css = "odd";
                }
                mrk.Add(m);
            }
            sqlcon.Close();
            return mrk;
        }







    }
}